package zjhr.com.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import zjhr.com.mapper.RecruitplanMapper;
import zjhr.com.pojo.EasyUIPageQuery;
import zjhr.com.pojo.Recruitplan;
import zjhr.com.service.RecruitPlanService;
import zjhr.com.utils.IDUtils;
@Service
public class RecruitPlanServiceImpl implements RecruitPlanService {
	@Autowired
	private RecruitplanMapper recruitMapper;

	@Override
	public void save(Recruitplan recruitplan) {
		recruitplan.setPlanid(IDUtils.genImageName());
		recruitMapper.insert(recruitplan);
	}
	//分页
	@Override
	public EasyUIPageQuery pageQuery(Integer page, Integer rows) {
		int total = recruitMapper.countByExample(null);
		int start =(page-1)*rows;
		List<Recruitplan> list = recruitMapper.pageQuery(start, rows.intValue());
		EasyUIPageQuery pageQuery= new EasyUIPageQuery(total, list);
		
		return pageQuery;
	}

}
